<template>
  <div class="remote-stream">
    <div :id="id" @click="handleClick"></div>
    <i class="remote-info">
      <span class="nick">{{nick}}</span>
      <img v-show="audioStatus===0" class="audio-icon" src="../components/assets/audio-true.png" alt="">
      <img v-show="audioStatus===1" class="audio-icon" src="../components/assets/audio-false.png" alt="">
      <img v-show="audioStatus===2" class="audio-icon" src="../components/assets/audio-active.png" alt="">
    </i>
  </div>
</template>

<script>
export default {
  props: {
    id: {
      type: String,
      default: 'String'
    },
    streamInfo: {
      type: Object,
      default: () => {
        return null
      }
    }
  },
  methods: {
    handleClick (e) {
      this.$emit('click', e)
    }
  },
  computed: {
    audioStatus () {
      return this.streamInfo.audio
    },
    nick () {
      return this.streamInfo.nick
    }
  }
}
</script>

<style>
.remote-stream{
  position: relative;
}
.remote-stream .remote-info{
  position: absolute;
  bottom: 0;
  right: 0;
  height: 25px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  font-style: normal;
}
.remote-stream .remote-info .nick{
  color: #fff;
  margin-right: 10px;
}
.remote-stream .remote-info .audio-icon{
  width: 20px;
  height: 20px;
  margin-right: 5px;
}
</style>
